package service.impl;

import com.simple.rpc.starter.SimpleRpcStarter;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * @author mhh
 * @since 2020/10/21
 */
@Component
public class Starter implements ApplicationListener {
    @Override
    public void onApplicationEvent(ApplicationEvent event) {
        if (event instanceof ContextRefreshedEvent) {
            SimpleRpcStarter simpleRpcStarter = SimpleRpcStarter.getStarter();
            simpleRpcStarter.providerInit();
        }
    }
}
